#include "mvtdialog.h"
#include "ui_mvtdialog.h"

MvtDialog::MvtDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MvtDialog)
{
    ui->setupUi(this);

    ClavNum *pad = new ClavNum(false, this);

    ui->horizontalLayout->addWidget(pad);

    setModal(true);

}

MvtDialog::~MvtDialog()
{
    delete ui;
}

int MvtDialog::mvt(QWidget *parent){
    MvtDialog d(parent);
    if(d.exec() == QDialog::Accepted){
        return d.ui->spinBox->value();
    }
    return 0;
}

int MvtDialog::restant(QWidget *parent){
    MvtDialog d(parent);
    d.ui->spinBox->setMinimum(0);
    d.ui->label->setText("Quantité restante");
    d.ui->label_2->setText("");
    if(d.exec() == QDialog::Accepted){
        return d.ui->spinBox->value();
    }
    return -1;
}
